package com.cooperate.fly.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/ued")
public class UEditorController extends BaseController {
    @RequestMapping("resources/ueditor")
    public String baiduUEditor(HttpServletRequest request, HttpServletResponse response){
    String path="ueditor/jsp/controller";	
    	return path;
//        try {/CooperateWeb/src/main/webapp/WEB-INF/resources/ueditor/jsp/controller.jsp
//            request.setCharacterEncoding("utf-8");
//            response.setHeader("Content-Type", "text/html");
//
//            String rootPath = request.getServletContext().getRealPath("/");
//
//            response.getWriter().write(new ActionEnter(request, rootPath).exec());
//        }catch(Exception e){
//            e.printStackTrace();
//        }
    	
    	//  response.setContentType("application/json");
//    	  request.setCharacterEncoding( "utf-8" );
//    		response.setHeader("Content-Type" , "text/html");
//    		
//    		String rootPath = application.getRealPath( "/" );
//    		
//    		out.write( new ActionEnter( request, rootPath ).exec() );
    	
/*    	   response.setHeader("Content-Type" , "text/html");
          String rootPath = request.getSession()
                  .getServletContext().getRealPath("/");        
        System.out.println("aa"+rootPath);
          try {
              String exec = new ActionEnter(request, rootPath).exec();
              PrintWriter writer = response.getWriter();
              writer.write(exec);
              writer.flush();
              writer.close();
          } catch (IOException e) {
              e.printStackTrace();
          }*/
    }
}
